<%@ page language="java"  pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>    
    <title>miGLE Mutation</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

	<link rel="stylesheet" type="text/css" href="css/miGLE.css"/>

  </head>

<BODY>
<jsp:include page="head.html" />
<TABLE cellSpacing=0 cellPadding=0 width=800 align=center border=0>
  <TBODY>
  <TR>
    <TD width=790 rowSpan=2>
      <DIV align=center>
      <TABLE id=table1 cellSpacing=0 cellPadding=0 width="80%" border=0>
        <TBODY>
        <TR>
          <TD>
		  <form action="servlet/MutationServlet" method=post>
		  <table width="693" height=350 border="0" cellspacing="1" cellpadding="1" height="261">
            <tr>
              <td colspan="2"><div align="left"><strong><font face="Arial"><span class="MsoNormal"><span style="font-size: 10.5pt;"><span lang="en-us"><br>This is the region for point mutation</span></span><span style="font-size: 10.5pt; font-family: Times New Roman;"><span lang="en-us"><span class="p"><span style="font-size: 10.5pt; font-family: Times New Roman;"><span lang="en-us">:<br><br></span></span></span></span></span></span></font></strong></div></td>
            </tr>
            
            <tr>
              <td width="38">&nbsp;</td>
              <td><div align="left">
                <p><%String fasta = session.getAttribute("seqfile").toString();
               		StringBuilder seq = new StringBuilder();
               		StringBuilder number = new StringBuilder();
                	String[] line = fasta.split("\n");
                	int startSeq = Integer.parseInt(session.getAttribute("start").toString());
                	session.setAttribute("start", session.getAttribute("start").toString());
   	            	for(int j=0; j<line.length; j++){
       	        		if(line[j].startsWith(">")){
       	        			out.print("<table>");
           	    			out.print("<tr><td width=\"120\"></td><td>" + line[j] + "\n" + "</td></tr>");
           	    		}else{
           	    			number.append((startSeq+60*(j-1)) + "-" + (startSeq+60*j) + "\t\n");
							for (int k = 0; k < line[j].length(); k++) {
								seq.append(line[j].charAt(k));
								if ((k + 1) % 60 == 0) {
									seq.append("\n");
									continue;
								}
								if ((k + 1) % 10 == 0) {
									seq.append("  ");
								}
							}           	    			
           	    		}
               		}
               		out.print("<tr><td width=\"120\"><pre>" + number.toString() + "</pre></td><td><pre>");
               		out.print(seq.toString());
               		out.print("</pre></td></tr></table>");%></p>
              </div></td>
            </tr>
            
            <tr><td colspan="3"><div align="left"><font face="Arial"><br></font><div align="left"><strong><font face="Arial"><span class="MsoNormal"><span style="font-size: 10.5pt;"><span lang="en-us">Please choose your mutation range</span></span><span style="font-size: 10.5pt; font-family: Times New Roman;"><span lang="en-us"><span class="p"><span style="font-size: 10.5pt; font-family: Times New Roman;"><span lang="en-us">:</span></span></span></span></span></span></font></strong></div></div></td></tr>
            <tr>
              <td width="38">&nbsp;</td>
              <td width="503"><div align="left"><br>&nbsp;core site&nbsp;  
              <input name="site" size="5" value="<%=session.getAttribute("site")%>"/>&nbsp; &nbsp; &nbsp;   
               <%=session.getAttribute("range")%><br><br><INPUT type=submit value=" Submit ">
                <INPUT type=reset value=" Clear ">
              </div></td>
			  <td width="142">&nbsp;</td>
            </tr>

			  <tr>
			  <td colspan="2"><P class=MsoNormal style="LINE-HEIGHT: 150%; TEXT-ALIGN: left" 
            align=left><SPAN 
            style="FONT-SIZE: 10.5pt; FONT-FAMILY: Times New Roman"><SPAN 
            lang=en-us><FONT face="Times New Roman"><B><SPAN class=style2><br></SPAN></B></FONT></SPAN></SPAN></P>
			    </td>
            </tr>
			
          </table></form></TD>
        </TR></TBODY></TABLE></DIV></TD></TR>
  <TR>
    <TD width=1 height=18></TD></TR>
<jsp:include page="end.jsp" />
	  </TBODY>
	  </TABLE>
	</BODY>
</html>


